import { useEffect, useState } from 'react'
import { channelsApi } from '@/apis/article'
export function useChannel() {
  // 获取频道列表
  const [channelsList, setChannelsList] = useState([])
  const getChanels = async () => {
    const res = await channelsApi()
    setChannelsList(res.data.channels)
  }
  useEffect(() => {
    getChanels()
  }, [])
  return {
    channelsList
  }
}